﻿@using BlankMvc.Models
@using Microsoft.AspNet.Identity


@if (Request.IsAuthenticated) {
    using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" })) {
        @Html.AntiForgeryToken()
        <style>
            .navbar-content {
                width: 320px;
                padding: 15px;
                padding-bottom: 0;
            }
        </style>
        <ul class="nav navbar-nav navbar-right">
            <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">Профиль <b class="caret"></b></a>
                <div class="dropdown-menu">
                    <div class="modal-body">
                        <div class="navbar-content">
                            <div class="row">
                                <div class="col-md-5">
                                    <img src="~/Content/img/photo.png" alt="Alternate Text" class="img-responsive img-circle" />
                                    <p class="text-center small">
                                        @Html.ActionLink("Изменить фото", "CropPicture", "Account", null, new { Class = "dax", @data_dismiss = "modal", @aria_hidden = "false" })
                                    </p>
                                </div>
                                <div class="col-md-7">
                                    <span>@User.Identity.GetUserName()</span>
                                    <p class="text-muted small">
                                        @User.Identity.GetEmail()
                                    </p>
                                    <div class="divider">
                                    </div>
                                    @Html.ActionLink("Просмотр профиля", "ViewProfile", "Account", null, new { Class = "gax btn btn-primary btn-sm active" })
                                </div>
                            </div>
                        </div>
                        <div class="navbar-footer">
                            <div class="navbar-footer-content">
                                <div class="row">
                                    <div class="col-md-6">
                                        <a href="#" class="btn btn-default btn-sm">Изменить пароль</a>
                                    </div>
                                    <div class="col-md-6">
                                        <a href="javascript:document.getElementById('logoutForm').submit()" class="btn btn-default btn-sm pull-right">Выйти</a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </li>
        </ul>
    }
} else {
    <ul class="nav navbar-nav navbar-right">
        <li>@Html.ActionLink("Регистрация", "RegisterForm", "Account", null, new { id = "registerLink", Class = "dax" })</li>
        <li>@Html.ActionLink("Вход", "LoginForm", "Account", null, new { id = "loginLink", Class = "dax" })</li>
    </ul>
    <div id="loginForms"></div>
}

